package com.legal.controller.practice;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.legal.domain.po.QuestionCategory;
import com.legal.domain.po.UserPracticeStats;
import com.legal.domain.result.Result;
import com.legal.service.practice.IQuestionCategoryService;
import com.legal.service.practice.IUserPracticeStatsService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 刷题功能模块 - 用户刷题状态管理 控制器
 * </p>
 *
 * @author xiaopeng
 * @since 2025-06-27
 */
@RestController
@RequestMapping("/practiceStatus")
@RequiredArgsConstructor
@Tag(name = "刷题状态管理")  // OpenAPI 3.0 注解
public class PracticeStatsController {

    private final IUserPracticeStatsService userPracticeStatsService;


    /**
     * 获取指定用户的 不同分类下的刷题状态
     */
    @Operation(summary = "获取所有分类")
    @GetMapping("/list")
    public Result<List<UserPracticeStats>> list(@RequestParam String userNo) {
        return Result.ok(userPracticeStatsService.list(
                new QueryWrapper<UserPracticeStats>().eq("user_no", userNo)));
    }


}
